package com.ts.manage.course;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ts.framework.domain.course.ext.CourseInfo;
import com.ts.framework.domain.course.request.CourseListRequest;
import com.ts.manage.course.dao.CourseMapper;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


public class test {
    @Autowired
    CourseMapper courseMapper;

    //测试分页
    @Test
    public void testPageHelper() {
        PageHelper.startPage(2, 1);
        CourseListRequest courseListRequest = new CourseListRequest();
        Page<CourseInfo> courseListByPage = courseMapper.findCourseListByPage(courseListRequest);
        List<CourseInfo> result = courseListByPage.getResult();
        System.out.println(result);
    }
}
